<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <header class="game-header">
            <h1>🐍 贪吃蛇游戏</h1>
            <div class="score-board">
                <div class="score-item">
                    <span class="label">分数:</span>
                    <span id="score" class="value">0</span>
                </div>
                <div class="score-item">
                    <span class="label">最高分:</span>
                    <span id="highScore" class="value">0</span>
                </div>
            </div>
        </header>

        <div class="game-area">
            <canvas id="gameCanvas" width="400" height="400"></canvas>
            
            <div class="game-overlay" id="gameOverlay">
                <div class="overlay-content">
                    <h2 id="overlayTitle">开始游戏</h2>
                    <p id="overlayMessage">点击开始按钮或按空格键开始游戏</p>
                    <div class="controls-info">
                        <p>使用方向键或 WASD 控制蛇的移动</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="game-controls">
            <button id="startBtn" class="btn btn-primary">开始游戏</button>
            <button id="pauseBtn" class="btn btn-secondary" disabled>暂停</button>
            <button id="restartBtn" class="btn btn-danger" disabled>重新开始</button>
        </div>

        <div class="mobile-controls">
            <div class="control-row">
                <button id="upBtn" class="control-btn">↑</button>
            </div>
            <div class="control-row">
                <button id="leftBtn" class="control-btn">←</button>
                <button id="downBtn" class="control-btn">↓</button>
                <button id="rightBtn" class="control-btn">→</button>
            </div>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html> 